<template>
  <view class="health-management-service">
    <view class="health-management-service-content">
      <view class="recommend-plan">
        <rich-text :nodes="healthData"></rich-text>
      </view>
      <view>参与健康计划与健康管理师咨询科学的管理服务，您将获得：</view>
      <rich-text :nodes="advantages" />
    </view>
    <button open-type="contact" class="button-purple">参与计划</button>
  </view>
</template>

<script>
export default {
  props: {
    healthData: {
      type: String,
      default: ""
    }
  },
  data() {
    return {
      advantagesItems: [
        "1对1的健康管理服务",
        "实时的健康状态跟踪",
        "定期的健康状态回访",
        "量身定制的科学膳食计划",
        "量身定制的科学运动计划",
        "量身定制的音乐疗愈计划",
        "健康问题咨询"
      ]
    };
  },
  computed: {
    advantages() {
      return [
        {
          name: "ul",
          attrs: {
            class: "advantages"
          },
          children: this.advantagesItems.map(content => ({
            name: "li",
            attrs: {
              class: "advantages-item"
            },
            children: [
              {
                type: "text",
                text: content
              }
            ]
          }))
        }
      ];
    }
  }
};
</script>

<style lang="less">
@import "./index.less";
</style>
